#构建微信小游戏
BuildProject=LitBuild_WxMiniGame.BuildDevProject
BuildBundle=LitBuild_WxMiniGame.BuildDevAssetBundle
BuildUnity=BuildScripts/build-unity.sh
Robot_Wx_Preview=BuildScripts/wx/robot_wx_preview.js
Robot_Wx_Upload=BuildScripts/wx/robot_wx_upload.js
# $(pwd) /Users/user1/.jenkins/workspace/lit-game-framework-minigame
UnityProjectPath=$(pwd)
AppId=wx757cb1d3bb936ed0
WxProjectPath=$(pwd)/Build/WxMiniGame_Dev/minigame
PrivateKey=$(pwd)/BuildScripts/wx/private.wx757cb1d3bb936ed0.key

if [ $1 = 'Project' ];then
    #构建小游戏工程
    echo BuildWxMiniGameProject -Begin
    sh $BuildUnity $UnityProjectPath $BuildProject
    echo BuildWxMiniGameProject -End
    #ci机器人预览
    echo CIPreview -Begin
    node $Robot_Wx_Preview $AppId $WxProjectPath $PrivateKey
    echo CIPreview -End
    #通讯软件发送消息
    echo SendMessage -Begin
    
    echo SendMessage -End
elif [ $1 = 'Preview' ];then
    echo CIPreview -Begin
    node $Robot_Wx_Preview $AppId $WxProjectPath $PrivateKey
    echo CIPreview -End
    #通讯软件发送消息
    echo SendMessage -Begin
    
    echo SendMessage -End
else
    #构建小游戏资源
    echo BuildWxMiniGameBundle -Begin
    sh $BuildUnity $UnityProjectPath $BuildBundle
    echo BuildWxMiniGameBundle -End
    #通讯软件发送消息
    echo SendMessage -Begin
    
    echo SendMessage -End
fi
